<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 <style type="text/css">
 				.cen{
 					margin:0 auto;
 					width: 80%;
 				}
				.form-groups {
				     margin-right: 15px; 
				    margin-left: 15px; 
				    margin-bottom: 15px;  
				}
				.bootstrap-dialog.type-primary .modal-header {
				    background-color: white;
				    text-align: center;
				}
				.bootstrap-dialog  .bootstrap-dialog-title {
				    color: black;
				    font-weight: 900;
				    font-size: 20px;
				}
				.modal-header {
				    min-height: 16.43px;
				    padding: 15px;
				    border-bottom: 1px ;
				}
				.modal-content{
					width: 80%;
				}
				.col-lg{
					width: 100%;
				}
				.search-labels {
				    float: left;
				    font-weight: bold;
				    color: inherit;
				    display: block;
				    padding: 0px 0px;
				    width: auto;
				    font-size: 14px;
				    margin-left: 5px;
				}
</style>
<form id="adForm" action="${BASE_PATH}/bus/user/doSendTemplate" method="post" class="form-horizontal" >
<input name="ids" value="${ids }" hidden="hidden">
	<div class="row cen">
		<div class="form-groups ">
		    <label class="col-lg "><label class="search-labels">发送类型：</label>
		  <!--  <input type="radio" id="mo" required minlength="1">模板短信
		   <input type="radio" id="ban">模板短信
		   <input type="radio" id="duan">模板短信 -->
		   模板消息
		    </label>
		</div>
		 <div class="huo">
		    <div class="form-groups">
				<label class="col-lg "><label class="search-labels">内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;容：</label><textarea type="text" value="" rows="3" cols="40" name="words" style="resize: none;height:50px; " required ></textarea></label>
			</div>
			<div class="form-groups">
				<label class="col-lg "><label class="search-labels">分公司名称：</label><textarea type="text" value="" rows="5" cols="40" name="storeName" style="resize: none;height:30px; " required ></textarea></label>
			</div>
			<div class="form-groups">
				<label class="col-lg "><label class="search-labels">服务时间：</label><input type="text" id="aBeginDate" name="startDate" value="" placeholder="年-月-日" class="form-control search-input width120 datetimepicker" data-format="yyyy-mm-dd" >
				<label class="search-label">至</label><input type="text" id="aEndDate" name="endDate" value="" placeholder="年-月-日" class="form-control search-input width120 datetimepicker" data-format="yyyy-mm-dd" >
			</div>
			<div class="form-groups">
				<label class="col-lg "><label class="search-labels">结&nbsp;束&nbsp;语&nbsp;：</label><textarea type="text" value="" rows="5" cols="40" name="jieWei" style="resize: none;height:60px;"></textarea></label>
			</div>
			<div class="form-groups">
				<label class="col-lg "><label class="search-labels">详情地址：</label><textarea type="text" value="" rows="5" cols="40" name="url" style="resize: none;height:60px;"></textarea></label>
			</div>
			<div class="form-groups ">
			   <div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" autocomplete="off">发送</button></div>
			 <div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left"  type="button" onclick="javascript:messageDialog.close();" autocomplete="off">取消</button></div>
			</div>
		</div> 
	</div>
</form>
<script type="text/javascript">
$(function(){
	//初始化表单验证
	$("#adForm").validate({
		ignore: "",
		messages:{
			message: {required: "请输入消息内容"}
		},
		submitHandler:function(form){
			$(form).ajaxSubmit({
				success:function(data){
					dataPaginator.loadPage(1);
					messageDialog.close();
				}
			});
		}
	});
});
//活动时间日历
$("#aBeginDate").datetimepicker({
    format: 'yyyy-mm-dd ',
    minuteStep:1,
    todayBtn : "true", 
    minView:'month',
    language: 'zh-CN',
    pickerPosition:'bottom-right',
    autoclose:true,
}).on("click",function(){
	var d2=new Date();
	var d=$("#aEndDate").val();
	if(d==""){
		 $("#aBeginDate").datetimepicker("aBeginDate",d2);
	}else{
		var d1=new Date(d); 
		d1.setDate(d1.getDate()-1);
		if(d1>d2){
	  	 	 $("#aBeginDate").datetimepicker("setEndDate",d2);
		}else{
			 $("#aBeginDate").datetimepicker("setEndDate",d1);
		}
	}
});

$("#aEndDate").datetimepicker({
    format: 'yyyy-mm-dd',
    minuteStep:1,
    todayBtn : "true", 
    minView:'month',
    language: 'zh-CN',
    autoclose:true,
	}).on("click",function(){
		var d=$("#aBeginDate").val();
		var d1=new Date(d); 
		d1.setDate(d1.getDate()+1); 
		$("#aEndDate").datetimepicker("setStartDate",d1);
	});
	
 $(document).on("click","#aEndDate",function(){
    	$('#aEndDate').datetimepicker('show');
    });

$(document).on("click","#aBeginDate",function(){
	$('#aBeginDate').datetimepicker('show');
});
</script>